package com.aspose.cells;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Iterator;

class zjn {
   private ChartCollection a;
   private Chart b;
   private zbwo c;
   private byte[] d;
   private zpb e;
   private int f;
   private byte[] g;
   private int h;
   private zast i;
   private WorksheetCollection j;
   private Worksheet k;
   private boolean l;
   private int m;
   private ArrayList n;
   private boolean o = false;
   private ArrayList p;
   private ArrayList q;
   private HashMap r;
   private byte s;
   private int t = 0;
   private zbsw u;
   private boolean v = false;
   private int w;
   private int x;

   zjn(zbwo var1, zpb var2, WorksheetCollection var3, Worksheet var4) {
      this.c = var1;
      this.e = var2;
      this.j = var3;
      this.k = var4;
      this.i = var3.m();
      this.a = var4.getCharts();
      this.d = new byte[2];
      this.n = new ArrayList();
      this.q = new ArrayList();
   }

   void a(Chart var1) throws Exception {
      var1.d(2);
      this.v = false;
      this.t = 0;
      this.b = var1;
      this.b.setShowLegend(false);
      this.o = false;
      this.l = false;
      var1.B().clear();

      label132:
      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
            this.A();
            this.m();
            return;
         case 20:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().c(this.g);
            }
            break;
         case 21:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().d(this.g);
            }
            break;
         case 38:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().setLeftMarginInch(com.aspose.cells.b.a.zc.f(this.g, 0));
            }
            break;
         case 39:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().setRightMarginInch(com.aspose.cells.b.a.zc.f(this.g, 0));
            }
            break;
         case 40:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().setTopMarginInch(com.aspose.cells.b.a.zc.f(this.g, 0));
            }
            break;
         case 41:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().setBottomMarginInch(com.aspose.cells.b.a.zc.f(this.g, 0));
            }
            break;
         case 51:
            this.b();
            switch(this.g[0]) {
            case 1:
               var1.setPrintSize(2);
               continue;
            case 2:
               var1.setPrintSize(1);
               continue;
            case 3:
               var1.setPrintSize(0);
            default:
               continue;
            }
         case 77:
            this.h = this.e.b(this.d);
            int var2 = this.e.b(this.d) & '\uffff';
            if (var2 != 0) {
               this.e.a((this.h & '\uffff') - 2);
               break;
            } else {
               byte[] var3 = new byte[(this.h & '\uffff') - 2];
               this.e.a(var3);
               ArrayList var4 = new ArrayList();
               com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
               int var5 = var3.length;

               while(true) {
                  while(true) {
                     this.f = this.e.b(this.d);
                     if ((this.f & '\uffff') == 77) {
                        this.h = this.e.b(this.d);
                        var2 = this.e.b(this.d) & '\uffff';
                        var3 = new byte[(this.h & '\uffff') - 2];
                        this.e.a(var3);
                        com.aspose.cells.b.a.a.ze.a(var4, (Object)var3);
                        var5 += var3.length;
                     } else {
                        if ((this.f & '\uffff') != 60) {
                           this.e.a(-2);
                           byte[] var6 = new byte[var5];
                           var5 = 0;

                           for(int var12 = 0; var12 < var4.size(); ++var12) {
                              var3 = (byte[])((byte[])var4.get(var12));
                              System.arraycopy(var3, 0, var6, var5, var3.length);
                              var5 += var3.length;
                           }

                           var1.getPageSetup().a(var6);
                           continue label132;
                        }

                        this.b();
                        com.aspose.cells.b.a.a.ze.a(var4, (Object)this.g);
                        var5 += this.h & '\uffff';
                     }
                  }
               }
            }
         case 160:
            if (this.k.getType() == 2) {
               this.b();
               this.k.setZoom((int)((double)((float)(com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff') * 100.0F / (float)(com.aspose.cells.b.a.zc.e(this.g, 2) & '\uffff')) + 0.5D));
            } else {
               this.e.a(6);
            }
            break;
         case 161:
            this.b();
            if (this.g != null && this.g.length != 0) {
               var1.getPageSetup().b(this.g);
            }
            break;
         case 233:
            this.b(this.e);
            break;
         case 236:
            zans var7 = new zans(this.c, this.e, this.j, this.k, this.b);
            var7.b();
            break;
         case 442:
            if (this.k.getType() == 2) {
               this.e();
            } else {
               this.h = this.e.b(this.d);
               this.e.a(this.h & '\uffff');
            }
            break;
         case 574:
            if (this.k.getType() == 2) {
               this.b();
               if ((this.g[2] & 255 & 6) != 0) {
                  this.j.setActiveSheetIndex(this.k.m());
               }
            } else {
               this.h = this.e.b(this.d);
               this.e.a(this.h & '\uffff');
            }
            break;
         case 2057:
            this.B();
            break;
         case 2129:
            this.k();
            break;
         case 2136:
            this.f();
            break;
         case 2138:
            this.j();
            break;
         case 2146:
            this.d();
            break;
         case 2150:
            this.c.a(this.e, var1.getPageSetup());
            break;
         case 2154:
            zbsw var10 = this.a((Axis)null, false);
            if (var10.B() != null) {
               var10.a((Chart)var1, (ArrayList)this.q, (ArrayList)null);
            }
            break;
         case 2204:
         case 2206:
            this.b();
            byte[] var11 = new byte[(this.h & '\uffff') + 4];
            System.arraycopy(com.aspose.cells.b.a.zc.a(this.f), 0, var11, 0, 2);
            System.arraycopy(com.aspose.cells.b.a.zc.a(this.h), 0, var11, 2, 2);
            System.arraycopy(this.g, 0, var11, 4, this.h & '\uffff');
            com.aspose.cells.b.a.a.ze.a(this.b.b(), (Object)var11);
            break;
         case 2215:
            this.a(this.e);
            break;
         case 4098:
            this.a();
            break;
         case 4099:
            Series var8 = new Series(this.j, var1.getNSeries(), var1.getNSeries().getCount());
            this.a(var8);
            break;
         case 4132:
            this.v();
            break;
         case 4133:
            zbsw var9 = new zbsw(this.j, this.b);
            this.a(var9, true);
            if (var9.B() != null) {
               switch(var9.A().a) {
               case 1:
                  var9.a(this.b.getTitle());
                  break;
               case 4:
                  var9.a(var1, this.q, this.p);
               }
            }
            break;
         case 4147:
            this.C();
            break;
         case 4148:
            this.D();
            break;
         case 4161:
            this.o();
            break;
         case 4164:
            this.w();
            this.t();
            break;
         case 4166:
            this.s();
            break;
         case 4192:
            this.a(this.b.B());
            break;
         case 4195:
            this.h();
            break;
         case 4196:
            this.u();
            break;
         case 4197:
            this.g();
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void b() throws Exception {
      this.c.a(this.e);
      this.g = this.c.a();
      this.h = this.c.b();
   }

   private void a(int var1) throws Exception {
      this.c.a(this.e, var1);
      this.g = this.c.a();
      this.h = this.c.b();
   }

   private void c() throws Exception {
      this.c.e(this.e);
      this.g = this.c.a();
      this.h = this.c.b();
   }

   private void d() throws Exception {
      this.b();
      int var1 = com.aspose.cells.b.a.zc.a(this.g, 16);
      if (var1 <= 65) {
         this.k.e(com.aspose.cells.b.a.zc.a(this.g, 16));
      }

   }

   private void a(zpb var1) throws Exception {
      this.b();
      PlotArea var2 = this.b.getPlotArea();
      var2.p = new byte[this.h];
      System.arraycopy(this.g, 0, var2.p, 0, this.h & '\uffff');
   }

   private void b(zpb var1) throws Exception {
      ArrayList var2 = new ArrayList();
      var1.a(-2);
      this.c();
      com.aspose.cells.b.a.a.ze.a(var2, (Object)this.g);
      int var3 = this.g.length - 12;
      int var4 = com.aspose.cells.b.a.zc.a(this.g, 8);

      for(var4 -= var3; var4 > 0; var4 -= this.g.length - 4) {
         this.c();
         short var5 = com.aspose.cells.b.a.zc.b(this.g, 0);
         if (var5 != 233 && var5 != 60) {
            throw new IOException("File is corrupted");
         }

         com.aspose.cells.b.a.a.ze.a(var2, (Object)this.g);
      }

      this.k.b(var2);
   }

   private void e() throws Exception {
      this.b();
      if (this.g[2] == 0) {
         this.k.k = zco.a(this.g, 3, this.g.length - 3);
      } else {
         this.k.k = Encoding.getUnicode().a(this.g, 3, this.g.length - 3);
      }

   }

   private void f() throws Exception {
      this.b();
      String var1 = Encoding.getUnicode().a(this.g, 8, this.g.length - 8);
      if (var1 != null && var1.length() > 0) {
         var1 = var1.trim();
         if (var1.charAt(0) == '[') {
            int var2 = var1.indexOf(93);
            if (var2 != -1) {
               if (var1.length() > var2 + 1) {
                  var1 = var1.substring(var2 + 1);
               } else {
                  var1 = null;
               }
            }
         }
      }

      if (var1 != null && var1.length() > 0) {
         this.b.setPivotSource(var1);
      }

      this.f = this.e.b(this.d);
      if ((this.f & '\uffff') == 2137) {
         this.b();
         this.b.setHidePivotFieldButtons(this.g[4] != 0);
      } else {
         this.e.a(-2);
      }

   }

   private void g() throws Exception {
      this.b();
      byte var1 = this.g[0];
      int var2 = 0;
      int var3 = 0;
      double var4 = 0.0D;
      ArrayList[] var7 = new ArrayList[this.q.size()];

      while(true) {
         this.f = this.e.b(this.d);
         String var6;
         int[] var8;
         int[] var9;
         switch(this.f) {
         case 10:
         case 442:
         case 2128:
            this.a(var7, var1);
            this.e.a(-2);
            return;
         case 513:
            this.b();
            var2 = com.aspose.cells.b.a.zc.e(this.g, 0);
            var3 = com.aspose.cells.b.a.zc.e(this.g, 2);
            if (var7[var3 & '\uffff'] == null) {
               var7[var3 & '\uffff'] = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var7[var3 & '\uffff'], (Object)(new zbmj(var2, true, false, "")));
            break;
         case 515:
            var8 = new int[]{var2};
            var9 = new int[]{var3};
            var4 = this.a(var8, var9);
            var2 = var8[0];
            var3 = var9[0];
            if (var7[var3 & '\uffff'] == null) {
               var7[var3 & '\uffff'] = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var7[var3 & '\uffff'], (Object)(new zbmj(var2, true, false, var4)));
            break;
         case 516:
            var8 = new int[]{var2};
            var9 = new int[]{var3};
            var6 = this.c(var8, var9);
            var2 = var8[0];
            var3 = var9[0];
            if (var7[var3 & '\uffff'] == null) {
               var7[var3 & '\uffff'] = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var7[var3 & '\uffff'], (Object)(new zbmj(var2, false, false, var6)));
            break;
         case 517:
            var8 = new int[]{var2};
            var9 = new int[]{var3};
            var6 = this.b(var8, var9);
            var2 = var8[0];
            var3 = var9[0];
            if (var7[var3 & '\uffff'] == null) {
               var7[var3 & '\uffff'] = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var7[var3 & '\uffff'], (Object)(new zbmj(var2, false, true, var6)));
            break;
         case 4197:
            this.a(var7, var1);
            this.b();
            var1 = this.g[0];
            var7 = new ArrayList[this.q.size()];
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void a(ArrayList[] var1, byte var2) {
      boolean var3 = false;
      zbmj var4 = null;

      for(int var5 = 0; var5 < var1.length; ++var5) {
         if (var1[var5] != null && var1[var5].size() != 0) {
            zhr var6 = (zhr)this.q.get(var5);
            zik var7 = zin.a(this.j, this.k);
            byte var8 = 1;
            int var11 = -1;
            Collections.sort(var1[var5], new zbmk());
            ArrayList var9 = new ArrayList();

            int var10;
            for(var10 = 0; var10 < var1[var5].size(); ++var10) {
               var4 = (zbmj)var1[var5].get(var10);
               if (!var4.d && !var4.c) {
                  var8 = 6;
                  break;
               }
            }

            for(var10 = 0; var10 < var1[var5].size(); ++var10) {
               var4 = (zbmj)var1[var5].get(var10);
               if ((var4.a & '\uffff') - var11 != 1) {
                  for(; var11 < (var4.a & '\uffff') - 1; ++var11) {
                     if (var8 == 6) {
                        com.aspose.cells.b.a.a.ze.a(var9, (Object)null);
                     } else {
                        com.aspose.cells.b.a.a.ze.a(var9, (Object)0.0D);
                     }
                  }
               }

               com.aspose.cells.b.a.a.ze.a(var9, var4.b);
               var11 = var4.a & '\uffff';
            }

            var7.a(var9);
            var7.a(var8);
            if (var6.b == 0) {
               Series var12 = (Series)var6.a;
               switch(var2) {
               case 1:
                  if (var12.l() == null) {
                     var12.a(var7);
                  } else {
                     var12.l().a(var9);
                  }
                  break;
               case 2:
                  if (var12.m() == null) {
                     var12.b(var7);
                  } else {
                     var12.m().a(var9);
                  }
                  break;
               case 3:
                  if (var12.n() == null) {
                     var12.c(var7);
                  } else {
                     var12.n().a(var9);
                  }
               }
            } else if (var6.b == 2) {
               ErrorBar var13 = (ErrorBar)var6.a;
               if (var6.c) {
                  if (var13.b() == null) {
                     var13.a(var7);
                  } else {
                     var13.b().a(var9);
                  }
               } else if (var13.c() == null) {
                  var13.b(var7);
               } else {
                  var13.c().a(var9);
               }
            }
         }
      }

   }

   private double a(int[] var1, int[] var2) throws Exception {
      this.b();
      var1[0] = com.aspose.cells.b.a.zc.e(this.g, 0);
      var2[0] = com.aspose.cells.b.a.zc.e(this.g, 2);
      return com.aspose.cells.b.a.zc.f(this.g, 6);
   }

   private String b(int[] var1, int[] var2) throws Exception {
      this.b();
      var1[0] = com.aspose.cells.b.a.zc.e(this.g, 0);
      var2[0] = com.aspose.cells.b.a.zc.e(this.g, 2);
      switch(this.g[6]) {
      case 0:
         return "#NULL!";
      case 7:
         return "#DIV/0!";
      case 15:
         return "#VALUE!";
      case 23:
         return "#REF!";
      case 29:
         return "#NAME?";
      case 36:
         return "#NUM!";
      case 42:
         return "#N/A";
      default:
         return "#N/A";
      }
   }

   private String c(int[] var1, int[] var2) throws Exception {
      this.b();
      var1[0] = com.aspose.cells.b.a.zc.e(this.g, 0);
      var2[0] = com.aspose.cells.b.a.zc.e(this.g, 2);
      int var3 = com.aspose.cells.b.a.zc.e(this.g, 6) & '\uffff';
      if (var3 == 0) {
         return "";
      } else {
         return this.g[8] == 0 ? Encoding.getASCII().a(this.g, 9, var3) : Encoding.getUnicode().a(this.g, 9, 2 * var3);
      }
   }

   private void h() throws Exception {
      this.b.setShowDataTable(true);
      this.i();
      int var1 = 0;
      ChartDataTable var2 = this.b.getChartDataTable();
      zbsw var3 = new zbsw(this.j, this.b);

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 4133:
            this.a(var3, false);
            break;
         case 4146:
            this.a((ChartFrame)var3);
            break;
         case 4147:
            ++var1;
            this.C();
            break;
         case 4148:
            this.D();
            --var1;
            if (var1 == 0) {
               if (var3 != null) {
                  var3.a(var2);
               }

               return;
            }
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void i() throws Exception {
      this.b();
      this.b.getChartDataTable().setHasBorderHorizontal((this.g[0] & 255 & 1) != 0);
      this.b.getChartDataTable().setHasBorderVertical((this.g[0] & 255 & 2) != 0);
      this.b.getChartDataTable().setHasBorderOutline((this.g[0] & 255 & 4) != 0);
      this.b.getChartDataTable().setShowLegendKey((this.g[0] & 255 & 8) != 0);
   }

   private void j() throws Exception {
      this.a(this.f & '\uffff');
      ArrayList var1 = new ArrayList();
      this.b.b = var1;
      com.aspose.cells.b.a.a.ze.a(var1, (Object)this.g);

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 2129:
         case 2132:
         case 2133:
            this.a(this.f & '\uffff');
            com.aspose.cells.b.a.a.ze.a(var1, (Object)this.g);
            break;
         case 2130:
         case 2131:
         default:
            this.e.a(-2);
            return;
         }
      }
   }

   private void k() throws Exception {
      this.e.a(-2);
      boolean var1 = false;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 2129:
            int var2 = this.e.b(this.d) & '\uffff';
            this.e.a(4);
            this.f = this.e.b(this.d);
            switch(this.f) {
            case 10:
            case 574:
               throw new IOException("File is corrupted");
            case 4192:
               this.a(this.n);
               continue;
            default:
               this.e.a(var2 - 6);
               continue;
            }
         case 2130:
         case 2131:
         case 2132:
         case 2133:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
            break;
         default:
            this.e.a(-2);
            return;
         }
      }
   }

   private void a(ArrayList var1) throws Exception {
      this.b();
      zbi var2 = new zbi(this.b, 0, false);
      var2.a = com.aspose.cells.b.a.zc.e(this.g, 0);
      var2.b = com.aspose.cells.b.a.zc.e(this.g, 2);
      var2.e = com.aspose.cells.b.a.zc.e(this.g, 4);
      var2.c = com.aspose.cells.b.a.zc.e(this.g, 6);
      var2.d = com.aspose.cells.b.a.zc.e(this.g, 8) & '\uffff';
      com.aspose.cells.b.a.a.ze.a(var1, (Object)var2);
   }

   private int l() throws Exception {
      this.b();
      int var1 = com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff';
      if (var1 == 65535) {
         var1 = 0;
      }

      return var1;
   }

   private void m() {
      if (!this.o) {
         this.b.getPlotArea().getArea().setFormatting(1);
         this.b.getPlotArea().getBorder().setVisible(false);
      }

      int var1 = this.b.m().a(false).j();
      int var2 = this.b.m().getCount();
      if (this.b.getNSeries().getCount() == 3 && var2 == 1 && var1 == 37) {
         if (this.b.c.a(0).n()) {
            var1 = 65;
         }
      } else if (this.b.getNSeries().getCount() == 4) {
         if (var2 == 1) {
            if (var1 == 37 && this.b.m().a(0).t()) {
               var1 = 66;
            }
         } else if (var2 == 2 && !this.b.m().a(0).m() && this.b.m().a(1).m() && var1 == 14 && this.b.m().a(1).j() == 37) {
            var1 = 67;
         }
      } else if (this.b.getNSeries().getCount() == 5 && var2 == 2 && !this.b.m().a(0).m() && this.b.m().a(1).m() && var1 == 14 && this.b.m().a(1).j() == 37 && this.b.m().a(1).t()) {
         var1 = 68;
      }

      this.b.b(var1);
      Iterator var3 = this.b.getNSeries().iterator();

      while(var3.hasNext()) {
         Series var4 = (Series)var3.next();
         if (var4.l() != null && var4.b() != null && var4.b().a() == 0) {
            ;
         }
      }

      if (this.b.l() != null && this.b.l().getCount() != 0) {
         var3 = this.b.getShapes().iterator();

         while(var3.hasNext()) {
            Shape var11 = (Shape)var3.next();
            if (var11.getPlacement() != 2) {
               var11.N().h().a(2);
               var11.setPlacement(1);
            }
         }
      }

      if (this.u != null || this.s != 0 || this.u != null) {
         zbsw var10 = this.u;
         if (this.r != null) {
            zary var10000;
            if (this.r.get(0) != null) {
               if (var10 == null) {
                  var10 = (zbsw)this.r.get(0);
               } else {
                  var10000 = var10.A();
                  var10000.e |= ((zbsw)this.r.get(0)).A().e;
               }
            }

            if (this.r.get(1) != null) {
               if (var10 == null) {
                  var10 = (zbsw)this.r.get(1);
               } else {
                  var10000 = var10.A();
                  var10000.e |= ((zbsw)this.r.get(1)).A().e;
               }
            }
         }

         for(int var12 = 0; var12 < this.q.size(); ++var12) {
            zhr var5 = (zhr)this.q.get(var12);
            if (var5.b == 0) {
               Series var6 = (Series)var5.a;
               boolean var7 = false;
               if (this.p != null) {
                  for(int var8 = 0; var8 < this.p.size(); ++var8) {
                     zary var9 = (zary)this.p.get(var8);
                     if ((var9.b & '\uffff') == var12 && (var9.c & '\uffff') == 65535) {
                        var7 = true;
                        break;
                     }
                  }
               }

               if (!var7) {
                  DataLabels var13 = var6.getDataLabels();
                  if (var10 != null) {
                     var10.a(var13, -1, this.p);
                  } else {
                     boolean var14 = (this.s & 255 & 1) != 0;
                     if (var14) {
                        var13.a((int)1, var14);
                     }

                     var14 = (this.s & 255 & 2) != 0;
                     if (var14) {
                        var13.a((int)2, var14);
                     }

                     var14 = (this.s & 255 & 16) != 0;
                     if (var14) {
                        var13.a((int)3, var14);
                     }

                     var14 = (this.s & 255 & 32) != 0;
                     if (var14) {
                        var13.a((int)4, var14);
                     }
                  }
               }
            }
         }
      }

      this.b.e = this.t;
      if (this.t != 0) {
         this.n();
      }

      if (ChartCollection.b(this.b.getType())) {
         if (!this.v) {
            this.b.getWalls().setFormatting(0);
         }

         this.b.x().a(this.b.getWalls(), (CopyOptions)null);
      }

   }

   private void n() {
      int var1 = 0;

      int var2;
      for(var2 = 0; var2 < this.q.size(); ++var2) {
         zhr var3 = (zhr)this.q.get(var2);
         if (var3.b == 0) {
            if (var3.g != null) {
               var3.g.b(var1);
            }

            ++var1;
         }
      }

      var2 = this.b.getNSeries().getCount();

      for(int var6 = 0; var6 < this.q.size(); ++var6) {
         zhr var4 = (zhr)this.q.get(var6);
         if (var4.b == 1) {
            if (var4.g != null) {
               var4.g.b(var1);
            }

            Trendline var5 = (Trendline)var4.a;
            var5.p(var1 - var2);
            ++var1;
         }
      }

   }

   private void o() throws Exception {
      this.b();
      boolean var1 = this.g[0] == 1;
      short var2 = com.aspose.cells.b.a.zc.b(this.g, 2);
      short var3 = com.aspose.cells.b.a.zc.b(this.g, 6);
      short var4 = com.aspose.cells.b.a.zc.b(this.g, 10);
      short var5 = com.aspose.cells.b.a.zc.b(this.g, 14);
      this.b.getPlotArea().c(var2, var3, var4, var5);
      Axis var6 = null;
      int var7 = 0;
      Color var8 = Color.getEmpty();
      boolean var9 = true;
      zbsw var10 = null;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2134:
            this.b(var6);
            break;
         case 2135:
            var10 = this.a(var6, false);
            if (var10.A() != null) {
               var10.a(var6, var6.getDisplayUnitLabel(), this.n);
            }
            break;
         case 2206:
            if (var7 == 2) {
               if (var6.a == null) {
                  var6.a = new ArrayList();
               }

               com.aspose.cells.b.a.a.ze.a(var6.a, (Object)this.p());
            } else {
               this.h = this.e.b(this.d);
               this.e.a(this.h & '\uffff');
            }
            break;
         case 2212:
            byte[] var15 = this.x();
            if (var15 != null) {
               if (var6.b == null) {
                  var6.b = new ArrayList();
               }

               com.aspose.cells.b.a.a.ze.a(var6.b, (Object)var15);
            }
            break;
         case 2213:
            var6.c = this.y();
            break;
         case 4116:
            this.a(var1);
            break;
         case 4125:
            this.b();
            var9 = true;
            var8 = Color.getEmpty();
            switch(this.g[0]) {
            case 0:
               if (var1) {
                  var6 = this.b.getSecondCategoryAxis();
               } else {
                  var6 = this.b.getCategoryAxis();
               }
               break;
            case 1:
               if (var1) {
                  var6 = this.b.getSecondValueAxis();
               } else {
                  var6 = this.b.getValueAxis();
               }

               var6.setMajorTickMark(0);
               break;
            case 2:
               var6 = this.b.getSeriesAxis();
            }

            var6.setVisible(true);
            break;
         case 4126:
            boolean[] var11 = new boolean[]{var9};
            var8 = this.a(var6, var11);
            var9 = var11[0];
            break;
         case 4127:
            this.d(var6);
            break;
         case 4128:
            this.f(var6);
            break;
         case 4129:
            this.e(var6);
            break;
         case 4133:
            var10 = new zbsw(this.j, this.b);
            this.a(var10, true);
            if (var10.B() != null) {
               var10.a(this.b, var1);
            }
            break;
         case 4134:
            int var12 = this.l();
            if (var12 != -1) {
               var6.getTickLabels().a(var12);
               zbi var13 = this.c(var12);
               var6.getTickLabels().a(var13 != null);
               Font var14 = this.b(var12);
               if (!a(var14, var8)) {
                  var6.getTickLabels().getFont().setColor(var8);
               }
            }
            break;
         case 4147:
            ++var7;
            this.C();
            break;
         case 4148:
            this.D();
            --var7;
            if (var7 == 0) {
               return;
            }
            break;
         case 4149:
            this.r();
            break;
         case 4174:
            this.c(var6);
            break;
         case 4175:
            this.a((ChartFrame)this.b.getPlotArea(), !var1);
            break;
         case 4194:
            this.g(var6);
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private byte[] p() throws Exception {
      this.b();
      int var1 = com.aspose.cells.b.a.zc.a(this.g, 12) + 4;
      byte[] var2 = new byte[var1];
      System.arraycopy(this.g, 16, var2, 0, var1);
      return var2;
   }

   static boolean a(Font var0, Color var1) {
      if (!com.aspose.cells.a.c.zh.a(var1)) {
         return var0.getColor().equals(var1);
      } else {
         return var0.b() == -1 || var0.b() > 56;
      }
   }

   private Font b(int var1) {
      return this.j.j(var1);
   }

   private zbi c(int var1) {
      Iterator var2 = this.b.B().iterator();

      zbi var3;
      do {
         if (!var2.hasNext()) {
            return null;
         }

         var3 = (zbi)var2.next();
      } while(var3.d != var1);

      return var3;
   }

   private zbsw a(Axis var1, boolean var2) throws Exception {
      if ((this.f & '\uffff') != 2135) {
         this.h = this.e.b(this.d);
         this.e.a(this.h & '\uffff');
      } else {
         this.a(var1);
      }

      boolean var3 = false;
      zbsw var4 = new zbsw(this.j, this.b);
      var4.j(var2);
      int var5 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 2129:
            int var6 = this.e.b(this.d) & '\uffff';
            this.e.a(4);
            this.f = this.e.b(this.d);
            switch(this.f) {
            case 10:
            case 574:
               throw new IOException("File is corrupted");
            case 4103:
               this.a(var4.getBorder());
               continue;
            case 4106:
               this.d(var4.getArea());
               continue;
            case 4109:
               var4.b(this.z());
               continue;
            case 4133:
               this.c(var4);
               continue;
            case 4134:
               var4.c(this.l());
               var4.q = this.c(var4.h());
               if ((this.h & '\uffff') + 8 < var6) {
                  this.e.a(var6 - 8 - (this.h & '\uffff'));
               }
               continue;
            case 4135:
               this.b(var4.A());
               if (var4.A().a == 4 && !var4.a()) {
                  if (this.p == null) {
                     this.p = new ArrayList();
                  }

                  com.aspose.cells.b.a.a.ze.a(this.p, (Object)var4.A());
               }
               continue;
            case 4146:
               this.b((ChartFrame)var4);
               continue;
            case 4147:
               this.e.a(var6 - 6);
               ++var5;
               continue;
            case 4164:
               this.e.a(var6 - 6);
               --var5;
               if (var5 == 0) {
                  return var4;
               }
               continue;
            case 4175:
               this.a((ChartFrame)var4, true);
               continue;
            case 4177:
               this.b(var4);
               continue;
            case 4198:
               this.a(var4.getArea());
               continue;
            default:
               this.e.a(var6 - 6);
               continue;
            }
         case 2130:
         case 2131:
         case 2132:
         case 2133:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
            break;
         case 2155:
            this.a(var4.B());
            break;
         default:
            this.e.a(-2);
            return var4;
         }
      }
   }

   private void a(Area var1) throws Exception {
      ArrayList var2 = new ArrayList();

      while(true) {
         this.b();
         com.aspose.cells.b.a.a.ze.a(var2, (Object)this.g);
         this.f = this.e.b(this.d);
         if ((this.f & '\uffff') != 2129) {
            break;
         }

         this.e.a(6);
         this.f = this.e.b(this.d);
         if ((this.f & '\uffff') != 4198 || (this.f & '\uffff') != 60) {
            this.e.a(-10);
            break;
         }
      }

      var1.getFillFormat().a(var1.getFillFormat().a(var2), false);
   }

   private void b(Area var1) throws Exception {
      this.b();
      TextureFill var2 = var1.getFillFormat().getTextureFill();
      if (var2 != null) {
         PicFormatOption var3 = new PicFormatOption();
         switch(this.g[0]) {
         case 1:
            var3.setType(0);
            break;
         case 2:
            var3.setType(1);
            break;
         case 3:
            var3.setType(2);
            break;
         default:
            var3.setType(0);
         }

         var3.a = com.aspose.cells.b.a.zc.e(this.g, 2);
         var3.a(com.aspose.cells.b.a.zc.e(this.g, 4));
         if (var3.getType() == 2) {
            var3.setScale(com.aspose.cells.b.a.zc.f(this.g, 6));
         }

         var2.setPicFormatOption(var3);
      }
   }

   private void c(Area var1) throws Exception {
      ArrayList var2 = new ArrayList();

      do {
         do {
            this.b();
            com.aspose.cells.b.a.a.ze.a(var2, (Object)this.g);
            this.f = this.e.b(this.d);
         } while((this.f & '\uffff') == 4198);
      } while((this.f & '\uffff') == 60);

      this.e.a(-2);
      var1.getFillFormat().a(var1.getFillFormat().a(var2), false);
   }

   private void a(Axis var1) throws Exception {
      this.b();
      var1.setDisplayUnitLabelShown((this.g[14] & 255 & 2) != 0);
      switch(this.g[4]) {
      case 1:
         var1.setDisplayUnit(1);
         break;
      case 2:
         var1.setDisplayUnit(2);
      case 3:
      case 4:
      case 6:
      case 7:
      default:
         break;
      case 5:
         var1.setDisplayUnit(5);
         break;
      case 8:
         var1.setDisplayUnit(8);
         break;
      case 9:
         var1.setDisplayUnit(9);
      }

   }

   private void b(Axis var1) throws Exception {
      this.b();
      if (var1.b() == 0) {
         var1.getTickLabels().setOffset(com.aspose.cells.b.a.zc.e(this.g, 4));
         if (var1.getTickLabelSpacing() == 1) {
            var1.a((this.g[8] & 255 & 1) != 0);
         }
      }

   }

   private Color a(Axis var1, boolean[] var2) throws Exception {
      this.b();
      switch(this.g[0]) {
      case 0:
         var1.setMajorTickMark(2);
         break;
      case 1:
         var1.setMajorTickMark(1);
         break;
      case 2:
         var1.setMajorTickMark(3);
         break;
      case 3:
         var1.setMajorTickMark(0);
      }

      switch(this.g[1]) {
      case 0:
         var1.setMinorTickMark(2);
         break;
      case 1:
         var1.setMinorTickMark(1);
         break;
      case 2:
         var1.setMinorTickMark(3);
         break;
      case 3:
         var1.setMinorTickMark(0);
      }

      switch(this.g[2]) {
      case 0:
         var1.setTickLabelPosition(3);
         break;
      case 1:
         var1.setTickLabelPosition(1);
         break;
      case 2:
         var1.setTickLabelPosition(0);
         break;
      case 3:
         var1.setTickLabelPosition(2);
      }

      if ((this.g[24] & 255 & 2) != 0) {
         var1.getTickLabels().setBackgroundMode(0);
      } else {
         switch(this.g[3]) {
         case 1:
            var1.getTickLabels().setBackgroundMode(2);
            break;
         case 2:
            var1.getTickLabels().setBackgroundMode(1);
         }
      }

      if ((this.g[24] & 255 & 32) == 0) {
         if ((this.g[28] & 255) > 90 && (this.g[28] & 255) != 255) {
            var1.getTickLabels().setRotationAngle(90 - (this.g[28] & 255));
         } else {
            if ((this.g[28] & 255) == 255) {
               var1.getTickLabels().b(true);
            }

            var1.getTickLabels().setRotationAngle(this.g[28]);
         }
      }

      if ((this.g[25] & 255 & 64) != 0) {
         var1.getTickLabels().setTextDirection(1);
      } else if ((this.g[25] & 255 & 128) != 0) {
         var1.getTickLabels().setTextDirection(2);
      }

      var2[0] = (this.g[24] & 255 & 1) != 0;
      return !var2[0] ? this.b(this.g, 4) : Color.getEmpty();
   }

   private void c(Axis var1) throws Exception {
      this.b();
      TickLabels var2 = var1.getTickLabels();
      var2.setNumberFormatLinked(false);
      int var3 = com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff';
      String var4 = this.g(var3);
      if (var4 != null && !"".equals(var4)) {
         var2.setNumberFormat(var4);
      } else {
         var2.c(var3);
      }

   }

   private void a(boolean var1) throws Exception {
      this.b();
      int var2 = com.aspose.cells.b.a.zc.e(this.g, 18) & '\uffff';
      ziz var3 = this.b.m().b(var2);
      var3.a(var1);
      var3.j((this.g[16] & 255 & 1) != 0);
      int var4 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2154:
            this.u = this.a((Axis)null, true);
            break;
         case 4102:
            this.a((Object)var3);
            break;
         case 4117:
            this.q();
            break;
         case 4119:
            this.m(var3);
            break;
         case 4120:
            this.j(var3);
            break;
         case 4121:
            this.i(var3);
            break;
         case 4122:
            this.e(var3);
            break;
         case 4123:
            this.g(var3);
            break;
         case 4124:
            this.f(var3);
            break;
         case 4130:
            this.k(var3);
            break;
         case 4132:
            this.v();
            break;
         case 4147:
            ++var4;
            this.C();
            break;
         case 4148:
            this.D();
            --var4;
            if (var4 == 0) {
               this.s(var3);
               return;
            }
            break;
         case 4154:
            this.l(var3);
            break;
         case 4157:
            this.a(var3);
            break;
         case 4158:
            this.d(var3);
            break;
         case 4159:
            this.b(var3);
            break;
         case 4160:
            this.c(var3);
            break;
         case 4193:
            this.h(var3);
            break;
         case 4199:
            this.b();
            var3.b = this.g;
            var3.k(false);
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void a(ziz var1) throws Exception {
      this.b();
      var1.i(true);
      DropBars var2 = var1.u();
      int var3 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 4103:
            this.a(var2.getBorder());
            break;
         case 4106:
            this.d(var2.getArea());
            break;
         case 4147:
            ++var3;
            this.C();
            break;
         case 4148:
            this.D();
            --var3;
            if (var3 == 0) {
               this.f = this.e.b(this.d);
               if ((this.f & '\uffff') != 4157) {
                  this.e.a(-2);
                  return;
               }

               this.b();
            }
            break;
         case 4198:
            this.c(var2.getArea());
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void b(ziz var1) throws Exception {
      this.b();
      if ((this.g[0] & 255 & 1) != 0) {
         var1.b(69);
      } else {
         var1.b(70);
      }

      var1.m((this.g[0] & 255 & 2) != 0);
   }

   private void c(ziz var1) throws Exception {
      this.b();
      var1.n((this.g[0] & 255 & 1) != 0);
      var1.b(59);
   }

   private void d(ziz var1) throws Exception {
      this.b();
      var1.n((this.g[0] & 255 & 1) != 0);
      var1.m((this.g[0] & 255 & 2) != 0);
      var1.b(58);
   }

   private void e(ziz var1) throws Exception {
      this.b();
      boolean var2 = (this.g[0] & 255 & 1) != 0;
      boolean var3 = (this.g[0] & 255 & 2) != 0;
      var1.m((this.g[0] & 255 & 4) != 0);
      if (var2) {
         if (var3) {
            var1.b(2);
         } else {
            var1.b(1);
         }
      } else {
         var1.b(0);
      }

   }

   private void f(ziz var1) throws Exception {
      this.b();
      Line var2 = null;
      switch(this.g[0]) {
      case 0:
         var1.g(true);
         var2 = var1.s();
         break;
      case 1:
         var1.c(true);
         var2 = var1.o();
         break;
      case 2:
         var1.e(true);
         var2 = var1.q();
         break;
      case 3:
         var2 = var1.N();
      }

      if (var2 != null) {
         this.f = this.e.b(this.d);
         if ((this.f & '\uffff') != 4103) {
            throw new IOException("File is corrupted");
         } else {
            this.a(var2);
         }
      }
   }

   private void g(ziz var1) throws Exception {
      this.b();
      boolean var2 = (this.g[4] & 255 & 1) != 0;
      if (var2) {
         var1.m((this.g[4] & 255 & 4) != 0);
         var1.l((this.g[4] & 255 & 2) != 0);
         var1.b(12);
         var1.h(com.aspose.cells.b.a.zc.e(this.g, 0));
         switch(this.g[2]) {
         case 1:
            var1.i(0);
            break;
         case 2:
            var1.i(1);
         }
      } else {
         var1.b(63);
      }

   }

   private void h(ziz var1) throws Exception {
      this.b();
      switch(this.g[0]) {
      case 0:
         return;
      case 1:
         var1.b(46);
         break;
      case 2:
         var1.b(49);
      }

      if (this.g[1] != 1) {
         switch(this.g[2]) {
         case 0:
            var1.g(0);
            var1.a((double)com.aspose.cells.b.a.zc.b(this.g, 4));
            break;
         case 1:
            var1.g(1);
            var1.a((double)com.aspose.cells.b.a.zc.b(this.g, 6));
            break;
         case 2:
            var1.g(2);
            var1.a(com.aspose.cells.b.a.zc.f(this.g, 12));
            break;
         case 3:
            var1.g(3);
            var1.k(false);
         }
      }

      var1.f(com.aspose.cells.b.a.zc.e(this.g, 8));
      var1.c(com.aspose.cells.b.a.zc.e(this.g, 10));
      var1.m((this.g[20] & 255 & 1) != 0);
   }

   private void i(ziz var1) throws Exception {
      this.b();
      var1.d(com.aspose.cells.b.a.zc.e(this.g, 0));
      var1.j(com.aspose.cells.b.a.zc.e(this.g, 2));
      var1.m((this.g[4] & 255 & 1) != 0);
      var1.o((this.g[4] & 255 & 2) != 0);
      if (var1.J() == 0) {
         var1.b(44);
      } else {
         var1.b(35);
      }

   }

   private void j(ziz var1) throws Exception {
      this.b();
      boolean var2 = (this.g[0] & 255 & 1) != 0;
      boolean var3 = (this.g[0] & 255 & 2) != 0;
      var1.m((this.g[0] & 255 & 4) != 0);
      byte var4 = 40;
      if (var2) {
         if (var3) {
            var4 = 42;
         } else {
            var4 = 41;
         }
      }

      var1.b(var4);
   }

   private void k(ziz var1) throws Exception {
      this.e.a(12);
   }

   private void l(ziz var1) throws Exception {
      this.b();
      this.b.setRotationAngle(com.aspose.cells.b.a.zc.b(this.g, 0));
      this.b.setElevation(com.aspose.cells.b.a.zc.b(this.g, 2));
      this.b.setPerspective((short)(com.aspose.cells.b.a.zc.b(this.g, 4) / 2));
      this.b.setHeightPercent(com.aspose.cells.b.a.zc.b(this.g, 6));
      this.b.setDepthPercent(com.aspose.cells.b.a.zc.b(this.g, 8));
      this.b.setGapDepth(com.aspose.cells.b.a.zc.b(this.g, 10));
      this.b.setAutoScaling((this.g[12] & 255 & 4) != 0);
      this.b.setWallsAndGridlines2D((this.g[12] & 255 & 32) != 0);
      this.b.setRightAngleAxes((this.g[12] & 255 & 1) == 0);
      boolean var2 = (this.g[12] & 255 & 2) != 0;
      switch(var1.j()) {
      case 0:
         var1.b(3);
         break;
      case 1:
         var1.b(4);
         break;
      case 2:
         var1.b(5);
      case 3:
      case 4:
      case 5:
      case 9:
      case 10:
      case 11:
      case 12:
      case 13:
      case 17:
      case 18:
      case 19:
      case 20:
      case 21:
      case 22:
      case 23:
      case 24:
      case 25:
      case 26:
      case 27:
      case 28:
      case 29:
      case 30:
      case 31:
      case 32:
      case 33:
      case 34:
      case 35:
      case 36:
      case 43:
      case 45:
      case 46:
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 58:
      case 59:
      case 60:
      case 61:
      case 62:
      case 63:
      case 64:
      case 65:
      case 66:
      case 67:
      case 68:
      default:
         break;
      case 6:
         var1.b(9);
         break;
      case 7:
         var1.b(10);
         break;
      case 8:
         var1.b(11);
         break;
      case 14:
         if (var2) {
            var1.b(18);
         } else {
            var1.b(17);
         }
         break;
      case 15:
         var1.b(19);
         break;
      case 16:
         var1.b(20);
         break;
      case 37:
      case 38:
      case 39:
      case 40:
      case 41:
      case 42:
         var1.b(43);
         break;
      case 44:
         var1.b(45);
         break;
      case 47:
         var1.b(48);
         break;
      case 69:
         if (this.b.getElevation() == 90 && this.b.getRotationAngle() == 0) {
            var1.b(71);
         }
         break;
      case 70:
         if (this.b.getElevation() == 90 && this.b.getRotationAngle() == 0) {
            var1.b(72);
         }
      }

   }

   private void m(ziz var1) throws Exception {
      this.b();
      var1.e(-com.aspose.cells.b.a.zc.b(this.g, 0));
      var1.c(com.aspose.cells.b.a.zc.b(this.g, 2));
      boolean var2 = (this.g[4] & 255 & 1) != 0;
      boolean var3 = (this.g[4] & 255 & 2) != 0;
      boolean var4 = (this.g[4] & 255 & 4) != 0;
      var1.m((this.g[4] & 255 & 8) != 0);
      byte var5;
      if (var2) {
         var5 = 6;
         if (var3) {
            if (var4) {
               var5 = 8;
            } else {
               var5 = 7;
            }
         }
      } else {
         var5 = 14;
         if (var3) {
            if (var4) {
               var5 = 16;
            } else {
               var5 = 15;
            }
         }
      }

      var1.b(var5);
   }

   private void q() throws Exception {
      this.b.setShowLegend(true);
      Legend var1 = this.b.getLegend();
      this.a(var1);
      int var2 = 0;
      zbsw var3 = new zbsw(this.j, this.b);

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2205:
            this.b();
            var3.t = new byte[this.h];
            System.arraycopy(this.g, 0, var3.t, 0, this.h & '\uffff');
            break;
         case 2213:
            this.b();
            var3.u = new byte[this.h];
            System.arraycopy(this.g, 0, var3.u, 0, this.h & '\uffff');
            break;
         case 4133:
            this.a(var3, false);
            break;
         case 4146:
            this.a((ChartFrame)var3);
            break;
         case 4147:
            ++var2;
            this.C();
            break;
         case 4148:
            this.D();
            --var2;
            if (var2 == 0) {
               var3.a(var1, true);
               return;
            }
            break;
         case 4175:
            this.b(var1);
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void a(Legend var1) throws Exception {
      this.b();
      boolean var2 = (this.g[18] & 255 & 1) != 0;
      var1.j((this.g[18] & 255 & 16) != 0);
      int var3 = com.aspose.cells.b.a.zc.a(this.g, 0);
      int var4 = com.aspose.cells.b.a.zc.a(this.g, 4);
      if (var3 >= 0 && var4 >= 0) {
         var1.e(var3);
         var1.f(var4);
         int var5 = com.aspose.cells.b.a.zc.a(this.g, 8);
         if (var5 != 0) {
            var1.h(var5);
         }

         var5 = com.aspose.cells.b.a.zc.a(this.g, 12);
         if (var5 != 0) {
            var1.g(var5);
         }

         var1.e((this.g[18] & 255 & 4) != 0);
         var1.f((this.g[18] & 255 & 8) != 0);
      }

      switch(this.g[16]) {
      case 0:
         var1.a(0);
         break;
      case 1:
         var1.a(1);
         break;
      case 2:
         var1.a(2);
         break;
      case 3:
         var1.a(3);
         break;
      case 4:
         var1.a(4);
      case 5:
      case 6:
      default:
         break;
      case 7:
         if (var1.i()) {
            var1.a(3);
         } else {
            var1.a(7);
         }
      }

   }

   private void r() throws Exception {
      this.o = true;
      this.e.a(2);
      int var1 = this.e.b(this.d);
      if ((var1 & '\uffff') != 4146) {
         throw new IOException("File is corrupted");
      } else {
         this.a((ChartFrame)this.b.getPlotArea());
      }
   }

   private void d(Axis var1) throws Exception {
      this.b();
      byte var2 = this.g[40];
      boolean var3 = (var2 & 255 & 32) != 0;
      var1.setLogarithmic(var3);
      if ((var2 & 255 & 1) == 0) {
         if (var3) {
            var1.setMinValue(Math.pow(10.0D, com.aspose.cells.b.a.zc.f(this.g, 0)));
         } else {
            var1.setMinValue(com.aspose.cells.b.a.zc.f(this.g, 0));
         }
      }

      if ((var2 & 255 & 2) == 0) {
         if (var3) {
            var1.setMaxValue(Math.pow(10.0D, com.aspose.cells.b.a.zc.f(this.g, 8)));
         } else {
            var1.setMaxValue(com.aspose.cells.b.a.zc.f(this.g, 8));
         }
      }

      if ((var2 & 255 & 4) == 0) {
         if (var3) {
            var1.setMajorUnit(Math.pow(10.0D, com.aspose.cells.b.a.zc.f(this.g, 16)));
         } else {
            var1.setMajorUnit(com.aspose.cells.b.a.zc.f(this.g, 16));
         }
      }

      if ((var2 & 255 & 8) == 0) {
         if (var3) {
            var1.setMinorUnit(Math.pow(10.0D, com.aspose.cells.b.a.zc.f(this.g, 24)));
         } else {
            var1.setMinorUnit(com.aspose.cells.b.a.zc.f(this.g, 24));
         }
      }

      if ((var2 & 255 & 16) == 0) {
         if (var3) {
            var1.c(Math.pow(10.0D, com.aspose.cells.b.a.zc.f(this.g, 32)));
         } else {
            var1.c(com.aspose.cells.b.a.zc.f(this.g, 32));
         }
      }

      var1.setPlotOrderReversed((var2 & 255 & 64) != 0);
      if ((var2 & 255 & 128) != 0) {
         var1.setCrossType(1);
      }

   }

   private void e(Axis var1) throws Exception {
      this.b();
      byte var2 = this.g[0];
      int var3 = this.e.b(this.d);
      if ((var3 & '\uffff') != 4103) {
         this.e.a(-2);
      } else {
         switch(var2) {
         case 0:
            this.h(var1);
            break;
         case 1:
            Line var4 = new Line(this.b, var1);
            this.a(var4);
            var1.a(var4);
            break;
         case 2:
            Line var5 = new Line(this.b, var1);
            this.a(var5);
            var1.b(var5);
            break;
         case 3:
            if (var1.b() == 0) {
               this.v = true;
               this.a(this.b.y().getBorder());
            } else if (var1.b() == 1) {
               this.a(this.b.r().getBorder());
            } else {
               this.v = true;
               this.a(this.b.y().getBorder());
            }

            var3 = this.e.b(this.d);
            if ((var3 & '\uffff') == 2132) {
               this.d(2133);
               var3 = this.e.b(this.d);
            }

            if ((var3 & '\uffff') != 4106) {
               throw new IOException("File is corrupted");
            }

            Object var6 = null;
            switch(var1.b()) {
            case 0:
               var6 = this.b.y();
               break;
            case 1:
               var6 = this.b.r();
               break;
            default:
               var6 = this.b.y();
            }

            this.d((Area)var6);
            var3 = this.e.b(this.d);
            if ((var3 & '\uffff') != 4198) {
               this.e.a(-2);
            } else {
               this.c((Area)var6);
            }
            break;
         default:
            throw new IOException("File is corrupted");
         }

      }
   }

   private void d(int var1) throws Exception {
      do {
         this.h = this.e.b(this.d);
         this.e.a(this.h & '\uffff');
         this.f = this.e.b(this.d);
      } while((this.f & '\uffff') != var1);

      this.h = this.e.b(this.d);
      this.e.a(this.h & '\uffff');
   }

   private void f(Axis var1) throws Exception {
      this.b();
      var1.setPlotOrderReversed((this.g[6] & 255 & 4) != 0);
      var1.setAxisBetweenCategories((this.g[6] & 255 & 1) != 0);
      boolean var2 = (this.g[6] & 255 & 2) != 0;
      if (var2) {
         var1.setCrossType(1);
      } else {
         var1.setCrossAt((double)com.aspose.cells.b.a.zc.e(this.g, 0));
      }

      int var3 = com.aspose.cells.b.a.zc.e(this.g, 2);
      if ((var3 & '\uffff') != 1) {
         var1.setTickLabelSpacing(var3);
      }

      var1.setTickMarkSpacing(com.aspose.cells.b.a.zc.e(this.g, 4));
   }

   private DateTime a(int var1, int var2) {
      if (var2 != 0) {
         DateTime var3 = new DateTime(1900, 1, 1);
         switch(var2) {
         case 1:
            var3 = var3.addMonths(var1);
            break;
         case 2:
            var3 = var3.addYears(var1);
         }

         return var3;
      } else {
         return CellsHelper.getDateTimeFromDouble((double)var1, this.j.n().getSettings().getDate1904());
      }
   }

   private void g(Axis var1) throws Exception {
      this.b();
      boolean var2 = (this.g[16] & 255 & 16) != 0;
      boolean var3 = (this.g[16] & 255 & 128) != 0;
      if (var2) {
         var1.setCategoryType(2);
      } else if (var3) {
         var1.setCategoryType(0);
      } else {
         var1.setCategoryType(1);
      }

      var1.setBaseUnitScale(this.h(this.g[12] & 255));
      var1.setBaseUnitAuto((this.g[16] & 255 & 32) != 0);
      int var4;
      if ((this.g[16] & 255 & 1) != 1) {
         var4 = com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff';
         if (var2 && !var1.isBaseUnitAuto()) {
            var1.setMinValue(this.a(var4, var1.getBaseUnitScale()));
         } else {
            var1.setMinValue(var4);
         }
      }

      if ((this.g[16] & 255 & 2) != 2) {
         var4 = com.aspose.cells.b.a.zc.e(this.g, 2) & '\uffff';
         if (var2 && !var1.isBaseUnitAuto()) {
            var1.setMaxValue(this.a(var4, var1.getBaseUnitScale()));
         } else {
            var1.setMaxValue(var4);
         }
      }

      if ((this.g[16] & 255 & 4) != 4) {
         var1.a((double)com.aspose.cells.b.a.zc.e(this.g, 4));
         var1.setAutomaticMajorUnit(false);
         var1.e(this.h(this.g[6] & 255));
      }

      if ((this.g[16] & 255 & 8) != 8) {
         var1.b((double)com.aspose.cells.b.a.zc.e(this.g, 8));
         var1.setAutomaticMinorUnit(false);
         var1.f(this.h(this.g[10] & 255));
      }

      if ((this.g[16] & 255 & 64) != 64) {
         var1.setCrossAt((double)com.aspose.cells.b.a.zc.e(this.g, 14));
      } else {
         if (var2 && var1.getCrossType() != 1) {
            var1.setCrossType(0);
         }

         var1.f = true;
      }

   }

   private void s() throws Exception {
      this.b();
      this.l = this.g[0] == 2;
   }

   private void t() throws Exception {
      this.b();
      this.b.a(this.g[0]);
      if ((this.g[0] & 255 & 24) == 24) {
         this.b.getPlotArea().e(false);
         this.b.getPlotArea().f(false);
         this.b.getPlotArea().g(false);
      }

      switch(this.g[2]) {
      case 0:
         this.b.setPlotEmptyCellsType(0);
         break;
      case 1:
         this.b.setPlotEmptyCellsType(1);
         break;
      case 2:
         this.b.setPlotEmptyCellsType(2);
      }

   }

   private int a(byte[] var1, int var2) {
      double var3 = (double)((float)(com.aspose.cells.b.a.zc.e(var1, var2 + 2) & '\uffff') + (float)(com.aspose.cells.b.a.zc.e(var1, var2) & '\uffff') / 65536.0F);
      return (int)(var3 * (double)this.j.L() / 72.0D + 0.5D);
   }

   void a() throws Exception {
      this.b();
      this.w = this.a((byte[])this.g, (int)8);
      this.x = this.a((byte[])this.g, (int)12);
      if (this.k.getType() == 2 && this.b == this.k.getCharts().get(0)) {
         this.b.getChartObject().a(0, false, this.a((byte[])this.g, (int)0), this.a((byte[])this.g, (int)4), this.w, this.x);
      }

   }

   private void u() throws Exception {
      this.b();
      this.b.a((double)((float)(com.aspose.cells.b.a.zc.e(this.g, 2) & '\uffff') + (float)(com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff') / 65536.0F));
      this.b.b((double)((float)(com.aspose.cells.b.a.zc.e(this.g, 6) & '\uffff') + (float)(com.aspose.cells.b.a.zc.e(this.g, 4) & '\uffff') / 65536.0F));
      this.f = this.e.b(this.d);
      if ((this.f & '\uffff') != 4146) {
         this.b.getChartArea().getBorder().setVisible(false);
         this.b.getChartArea().getArea().setFormatting(1);
         this.e.a(-2);
      } else {
         this.a((ChartFrame)this.b.getChartArea());
         this.b.setRectangularCornered(!this.b.getChartArea().getArea().getInvertIfNegative());
      }
   }

   private void a(ChartFrame var1) throws Exception {
      this.b(var1);
      int var2 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2212:
            var1.a = this.x();
            break;
         case 4103:
            this.a(var1.getBorder());
            break;
         case 4106:
            this.d(var1.getArea());
            break;
         case 4147:
            ++var2;
            this.C();
            break;
         case 4148:
            this.D();
            --var2;
            if (var2 == 0) {
               return;
            }
            break;
         case 4198:
            this.c(var1.getArea());
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void v() throws Exception {
      this.b();
      byte var1 = this.g[0];
      this.f = this.e.b(this.d);
      zbsw var2 = new zbsw(this.j, this.b);
      var2.j(true);
      this.a(var2, false);
      switch(var1) {
      case 0:
      case 1:
         if (var2.A() != null && var2.A().d) {
            if (this.r == null) {
               this.r = new HashMap();
            }

            this.r.put(var1 & 255, var2);
         }
         break;
      case 2:
         var2.a(this.b.getChartArea(), false, false);
         break;
      case 3:
         if (var2.h() != -1) {
            this.b.getChartArea().a(var2.h());
         }
      }

   }

   private void a(zbsw var1, boolean var2) throws Exception {
      this.c(var1);
      int var3 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2155:
            this.a(var1.B());
            break;
         case 2205:
            this.b();
            var1.t = new byte[this.h];
            System.arraycopy(this.g, 0, var1.t, 0, this.h & '\uffff');
            break;
         case 2213:
            this.b();
            var1.u = new byte[this.h];
            System.arraycopy(this.g, 0, var1.u, 0, this.h & '\uffff');
            break;
         case 4109:
            var1.b(this.z());
            break;
         case 4134:
            var1.c(this.l());
            var1.q = this.c(var1.h());
            break;
         case 4135:
            this.b(var1.A());
            if (var1.A().a == 4 && !var1.a()) {
               if (this.p == null) {
                  this.p = new ArrayList();
               }

               com.aspose.cells.b.a.a.ze.a(this.p, (Object)var1.A());
            }
            break;
         case 4146:
            var1.s = true;
            this.a((ChartFrame)var1);
            break;
         case 4147:
            this.C();
            ++var3;
            break;
         case 4148:
            this.D();
            --var3;
            if (var3 == 0) {
               return;
            }
            break;
         case 4175:
            this.a((ChartFrame)var1, var2);
            break;
         case 4176:
            this.a(var1);
            break;
         case 4177:
            this.b(var1);
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void a(zbsw var1) throws Exception {
      this.b();
      var1.a((ArrayList)(new ArrayList()));
      boolean var2 = false;
      int var3 = 0;

      for(int var4 = 2; var4 < (this.h & '\uffff') - 4; var4 += 4) {
         int var6 = var3;
         var3 = com.aspose.cells.b.a.zc.e(this.g, var4 + 4) & '\uffff';
         FontSetting var5 = new FontSetting(var6, var3 - var6, this.j, true);
         var5.getFont().c(this.j.j(com.aspose.cells.b.a.zc.e(this.g, var4 + 2) & '\uffff'));
         com.aspose.cells.b.a.a.ze.a(var1.D(), (Object)var5);
      }

   }

   private void a(zary var1) throws Exception {
      this.b();
      if (var1 != null) {
         var1.d = true;
         var1.e = this.g[12];
         int var2 = com.aspose.cells.b.a.zc.e(this.g, 14) & '\uffff';
         if (var2 != 0) {
            if (this.g[16] == 0) {
               var1.f = Encoding.getASCII().a(this.g, 17, var2);
            } else {
               var1.f = Encoding.getUnicode().a(this.g, 17, 2 * var2);
            }
         }

      }
   }

   private void b(zary var1) throws Exception {
      this.b();
      var1.a = this.g[0];
      var1.b = com.aspose.cells.b.a.zc.e(this.g, 2);
      var1.c = com.aspose.cells.b.a.zc.e(this.g, 4);
   }

   private void b(zbsw var1) throws Exception {
      this.b();
      var1.n = (this.g[2] & 255 & 1) == 0;
      int var2;
      if (!var1.n) {
         var2 = com.aspose.cells.b.a.zc.e(this.g, 4) & '\uffff';
         String var3 = this.g(var2);
         if (var3 != null && !"".equals(var3)) {
            var1.a(var3);
         }

         var1.a(var2);
      }

      var2 = com.aspose.cells.b.a.zc.e(this.g, 6) & '\uffff';
      if (var2 != 0) {
         var1.x = new byte[var2 + 2];
         System.arraycopy(this.g, 6, var1.x, 0, var1.x.length);
      }

   }

   private void b(Legend var1) throws Exception {
      this.b();
      var1.g(this.g[2] == 2);
      if (!var1.l()) {
         if (this.b.getChartObject().P()) {
            var1.n((int)((float)(var1.p() * this.w) * 72.0F / (float)(this.j.L() * 4000) - (float)com.aspose.cells.b.a.zc.a(this.g, 12)));
            var1.o((int)((float)(var1.o() * this.x) * 72.0F / (float)(this.j.L() * 4000) - (float)com.aspose.cells.b.a.zc.a(this.g, 16)));
         } else {
            var1.n((int)((float)var1.getWidth() / 4000.0F * (float)this.w * 72.0F / (float)this.j.L() - (float)com.aspose.cells.b.a.zc.a(this.g, 12)));
            var1.o((int)((float)var1.getHeight() / 4000.0F * (float)this.x * 72.0F / (float)this.j.M() - (float)com.aspose.cells.b.a.zc.a(this.g, 16)));
         }
      }

   }

   private void a(ChartFrame var1, boolean var2) throws Exception {
      if (var2) {
         this.b();
         var1.e(com.aspose.cells.b.a.zc.b(this.g, 4));
         var1.f(com.aspose.cells.b.a.zc.b(this.g, 8));
         var1.h(com.aspose.cells.b.a.zc.b(this.g, 12));
         var1.g(com.aspose.cells.b.a.zc.b(this.g, 16));
      } else {
         this.e.a(22);
      }

   }

   private void c(zbsw var1) throws Exception {
      this.b();
      switch(this.g[0]) {
      case 1:
         var1.setTextHorizontalAlignment(7);
         break;
      case 2:
         var1.setTextHorizontalAlignment(1);
         break;
      case 3:
         var1.setTextHorizontalAlignment(8);
         break;
      case 4:
         var1.setTextHorizontalAlignment(6);
      case 5:
      case 6:
      default:
         break;
      case 7:
         var1.setTextHorizontalAlignment(3);
      }

      switch(this.g[1]) {
      case 1:
         var1.setTextVerticalAlignment(9);
         break;
      case 2:
         var1.setTextVerticalAlignment(1);
         break;
      case 3:
         var1.setTextVerticalAlignment(0);
         break;
      case 4:
         var1.setTextVerticalAlignment(6);
      case 5:
      case 6:
      default:
         break;
      case 7:
         var1.setTextVerticalAlignment(3);
      }

      if ((this.h & '\uffff') > 8) {
         zbst var2 = var1.z();
         var2.a = com.aspose.cells.b.a.zc.a(this.g, 8);
         var2.b = com.aspose.cells.b.a.zc.a(this.g, 12);
         var2.c = com.aspose.cells.b.a.zc.a(this.g, 16);
         var2.d = com.aspose.cells.b.a.zc.a(this.g, 20);
         var1.p = com.aspose.cells.b.a.zc.e(this.g, 24);
         boolean var3 = (this.g[24] & 255 & 128) != 0;
         if (var3) {
            var1.setBackgroundMode(0);
         } else {
            switch(this.g[2]) {
            case 1:
               var1.setBackgroundMode(2);
               break;
            case 2:
               var1.setBackgroundMode(1);
            }
         }

         int var4 = com.aspose.cells.b.a.zc.e(this.g, 30);
         if ((var4 & '\uffff') == 255) {
            var1.setRotationAngle(255);
            var1.l(true);
         } else if ((var4 & '\uffff') == 254) {
            var1.o = true;
         } else if ((var4 & '\uffff') > 90) {
            var1.setRotationAngle(90 - (var4 & '\uffff'));
         } else {
            var1.setRotationAngle(var4);
         }

         if ((this.g[29] & 255 & 64) != 0) {
            var1.setTextDirection(1);
         } else if ((this.g[29] & 255 & 128) != 0) {
            var1.setTextDirection(2);
         }

         switch(this.g[28] & 255 & 15) {
         case 1:
            var1.n(3);
            break;
         case 2:
            var1.n(2);
            break;
         case 3:
            var1.n(0);
            break;
         case 4:
            var1.n(1);
            break;
         case 5:
            var1.n(4);
            break;
         case 6:
            var1.n(5);
            break;
         case 7:
            var1.n(6);
            break;
         case 8:
            var1.n(7);
            break;
         case 9:
            var1.n(8);
            break;
         case 10:
            var1.r = true;
            var1.n(9);
         }

         if ((this.g[24] & 255 & 1) == 0) {
            var1.a(this.c(this.g, 26));
         } else {
            var1.a(Color.getEmpty());
         }

         var1.m = (this.g[24] & 255 & 2) != 0;
      }
   }

   private void a(Series var1) throws Exception {
      this.d(var1);
      int var2 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 4102:
            this.a((Object)var1);
            break;
         case 4109:
            String var3 = this.z();
            if (var1.k() == null) {
               var1.a((Object)var3);
            } else {
               var1.b = var3;
            }
            break;
         case 4147:
            ++var2;
            this.C();
            break;
         case 4148:
            this.D();
            --var2;
            if (var2 == 0) {
               return;
            }
            break;
         case 4163:
            this.e(this.q.size() - 1);
            break;
         case 4165:
            this.c(var1);
            this.b.getNSeries().a(var1);
            com.aspose.cells.b.a.a.ze.a(this.q, (Object)(new zhr(var1, (byte)0)));
            break;
         case 4170:
            this.b(var1);
            break;
         case 4177:
            this.e(var1);
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private void e(int var1) throws Exception {
      this.b();
      int var2 = com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff';
      if (var2 == 65535) {
         var2 = var1;
      }

      LegendEntry var3 = this.b.getLegend().getLegendEntries().get(var2);
      zhr var4 = (zhr)this.q.get(var1);
      var4.g = var3;
      if ((this.g[2] & 255 & 1) != 0) {
         var3.setDeleted(true);
      } else {
         zbsw var5 = new zbsw(this.j, this.b);
         int var6 = 0;

         while(true) {
            this.f = this.e.b(this.d);
            switch(this.f) {
            case 10:
            case 574:
               throw new IOException("File is corrupted");
            case 4133:
               this.a(var5, false);
               break;
            case 4147:
               ++var6;
               this.C();
               break;
            case 4148:
               this.D();
               --var6;
               if (var6 == 0) {
                  var5.a(var3);
                  return;
               }
               break;
            default:
               this.h = this.e.b(this.d);
               this.e.a(this.h & '\uffff');
            }
         }
      }
   }

   private void b(Series var1) throws Exception {
      this.b();
      int var2 = (com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff') - 1;
      zhr var3 = null;
      if (var2 >= this.q.size()) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 4171:
            var3 = new zhr(var1, (byte)1);
            this.b();
            var3.d = this.g;
            var3.e = var2;
            com.aspose.cells.b.a.a.ze.a(this.q, (Object)var3);
            break;
         case 4187:
            var3 = new zhr(var1, (byte)2);
            this.b();
            var3.d = this.g;
            var3.e = var2;
            com.aspose.cells.b.a.a.ze.a(this.q, (Object)var3);
            break;
         default:
            this.e.a(-2);
         }

      } else {
         var3 = (zhr)this.q.get(var2);
         if (var3.b == 0) {
            Series var4 = (Series)var3.a;
            this.f = this.e.b(this.d);
            switch(this.f) {
            case 4171:
               this.b(var4, var1, (zhr)null);
               ++this.t;
               break;
            case 4187:
               this.a(var4, var1, (zhr)null);
               break;
            default:
               this.e.a(-2);
            }

         } else {
            throw new CellsException(6, "Unspported TrendLine/ErrorBar in the chart.");
         }
      }
   }

   private void a(Series var1, Series var2, zhr var3) throws Exception {
      this.b();
      boolean var4 = true;
      boolean var5 = true;
      byte var7;
      switch(this.g[0]) {
      case 1:
         var4 = false;
         var7 = 3;
         break;
      case 2:
         var4 = false;
         var7 = 1;
         break;
      case 3:
         var7 = 3;
         break;
      case 4:
         var7 = 1;
         break;
      default:
         return;
      }

      ErrorBar var6 = null;
      if (var4) {
         var6 = var1.getYErrorBar();
      } else {
         var6 = var1.getXErrorBar();
      }

      if (var3 == null) {
         var3 = new zhr(var6, (byte)2);
         com.aspose.cells.b.a.a.ze.a(this.q, (Object)var3);
      } else {
         var3.a = var6;
      }

      var3.c = var7 == 3;
      if (var6.getDisplayType() != 2 && var6.getDisplayType() != var7 && var6.a() == var4) {
         var6.a(0);
         if (var6.getType() == 0) {
            switch(var7) {
            case 1:
               var6.b(var2.l());
               break;
            case 3:
               var6.a(var2.l());
            }
         }

      } else {
         var6.a(var7);
         switch(this.g[1]) {
         case 1:
            var6.setType(2);
            break;
         case 2:
            var6.setType(1);
            break;
         case 3:
            var6.setType(3);
            break;
         case 4:
            var6.setType(0);
            break;
         case 5:
            var6.setType(4);
         }

         var6.setShowMarkerTTop(this.g[2] == 1);
         var6.a(com.aspose.cells.b.a.zc.f(this.g, 4));
         var6.a((Line)var2.getBorder());
         if (var6.getType() == 0) {
            switch(var7) {
            case 1:
               var6.b(var2.l());
               break;
            case 3:
               var6.a(var2.l());
            }
         }

      }
   }

   private void w() throws Exception {
      for(int var1 = 0; var1 < this.q.size(); ++var1) {
         zhr var2 = (zhr)this.q.get(var1);
         if (var2.b != 0 && var2.d != null) {
            zhr var3 = (zhr)this.q.get(var2.e);
            if (var3.b == 0) {
               switch(var2.b) {
               case 1:
                  this.b((Series)var3.a, (Series)var2.a, var2);
                  break;
               case 2:
                  this.a((Series)var3.a, (Series)var2.a, var2);
               }
            }
         }
      }

   }

   private void b(Series var1, Series var2, zhr var3) throws Exception {
      if (var3 == null) {
         this.b();
      }

      byte var4 = 1;
      switch(this.g[0]) {
      case 0:
         if (this.g[1] == 1) {
            var4 = 1;
         } else {
            var4 = 4;
         }
         break;
      case 1:
         var4 = 0;
         break;
      case 2:
         var4 = 2;
         break;
      case 3:
         var4 = 5;
         break;
      case 4:
         var4 = 3;
      }

      int var5 = var1.getTrendLines().a(var4);
      Trendline var6 = var1.getTrendLines().get(var5);
      if (var3 == null) {
         com.aspose.cells.b.a.a.ze.a(this.q, (Object)(new zhr(var6, (byte)1)));
      } else {
         var3.a = var6;
      }

      switch(var4) {
      case 3:
         var6.o(this.g[1] & 255);
         break;
      case 4:
         var6.d = this.g[1] & 255;
      }

      double var7 = com.aspose.cells.b.a.zc.f(this.g, 2);
      if (!Double.isNaN(var7)) {
         var6.setIntercept(var7);
      }

      var6.setDisplayEquation(this.g[10] == 1);
      var6.setDisplayRSquared(this.g[11] == 1);
      var6.setForward(com.aspose.cells.b.a.zc.f(this.g, 12));
      var6.a(com.aspose.cells.b.a.zc.f(this.g, 20));
      if (var2.getName() != null && !"".equals(var2.getName())) {
         var6.setNameAuto(false);
         var6.setName(var2.getName());
      }

      var6.a(var2.getBorder());
   }

   private void c(Series var1) throws Exception {
      this.b();
      var1.a(this.f(com.aspose.cells.b.a.zc.e(this.g, 0) & '\uffff'));
   }

   private void a(Object var1) throws Exception {
      this.b();
      boolean var2 = false;
      zor var3 = new zor(var1);
      if ((this.g[6] & 255 & 1) != 0) {
         var3.c = true;
      }

      if (var1 instanceof Series) {
         Series var4 = (Series)var1;
         int var5 = com.aspose.cells.b.a.zc.e(this.g, 0);
         if ((var5 & '\uffff') == 65534) {
            this.E();
            return;
         }

         if (var5 != 65535) {
            ChartPoint var6 = var4.getPoints().a(var5 & '\uffff');
            var6.a(var3);
            var1 = var6;
            var2 = true;
         } else {
            var4.a(var3);
            var4.a(com.aspose.cells.b.a.zc.e(this.g, 4));
         }
      } else if (var1 instanceof ziz) {
         ziz var7 = (ziz)var1;
         var7.a(var3);
      }

      int var8 = 0;
      boolean var9 = false;
      boolean var10 = false;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 2206:
            if (var3.a == null) {
               var3.a = new ArrayList();
            }

            com.aspose.cells.b.a.a.ze.a(var3.a, (Object)this.p());
            break;
         case 2212:
            var3.b = this.x();
            break;
         case 4103:
            this.a(var3.f());
            var9 = true;
            break;
         case 4105:
            this.a(var3.j());
            break;
         case 4106:
            this.d(var3.e());
            var10 = true;
            break;
         case 4107:
            this.a(var3.l());
            break;
         case 4108:
            if (var1 instanceof Series) {
               this.a(((Series)var1).getDataLabels());
            } else if (var1 instanceof ChartPoint) {
               this.a(((ChartPoint)var1).getDataLabels());
            } else if (var1 instanceof ziz) {
               this.b();
               this.s = this.g[0];
            } else {
               this.a((DataLabels)null);
            }
            break;
         case 4147:
            ++var8;
            this.C();
            break;
         case 4148:
            if (var2 && !var10 && !var9) {
               var3.f().b(true);
               var3.e().setFormatting(0);
            }

            this.D();
            --var8;
            if (var8 == 0) {
               return;
            }
            break;
         case 4156:
            this.b(var3.e());
            break;
         case 4189:
            this.a(var3);
            break;
         case 4191:
            this.b(var3);
            break;
         case 4198:
            this.c(var3.e());
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private byte[] x() throws Exception {
      this.b();
      int var1 = this.h & '\uffff';
      byte[] var2 = new byte[var1];
      System.arraycopy(this.g, 0, var2, 0, var1);
      return var2;
   }

   private byte[] y() throws Exception {
      this.b();
      int var1 = this.h & '\uffff';
      byte[] var2 = new byte[var1];
      System.arraycopy(this.g, 0, var2, 0, var1);
      return var2;
   }

   private void a(zor var1) throws Exception {
      this.b();
      var1.b((this.g[0] & 255 & 1) != 0);
      var1.d((this.g[0] & 255 & 2) != 0);
      var1.f((this.g[0] & 255 & 4) != 0);
   }

   private void b(zor var1) throws Exception {
      this.b();
      switch(this.g[0]) {
      case 0:
         switch(this.g[1]) {
         case 0:
            var1.b(0);
            return;
         case 1:
            var1.b(1);
            return;
         case 2:
            var1.b(2);
            return;
         default:
            return;
         }
      case 1:
         switch(this.g[1]) {
         case 0:
            var1.b(3);
            break;
         case 1:
            var1.b(4);
            break;
         case 2:
            var1.b(5);
         }
      }

   }

   private void a(DataLabels var1) throws Exception {
      if (var1 == null) {
         this.e.a(4);
      } else {
         this.b();
         boolean var2 = (this.g[0] & 255 & 1) != 0;
         if (var2) {
            var1.a((int)1, var2);
         }

         var2 = (this.g[0] & 255 & 2) != 0;
         if (var2) {
            var1.a((int)2, var2);
         }

         var2 = (this.g[0] & 255 & 16) != 0;
         if (var2) {
            var1.a((int)3, var2);
         }

         var2 = (this.g[0] & 255 & 32) != 0;
         if (var2) {
            var1.a((int)4, var2);
         }

      }
   }

   private void d(Series var1) throws Exception {
      this.b();
      this.m = com.aspose.cells.b.a.zc.e(this.g, 6) & '\uffff';
   }

   private String z() throws Exception {
      this.b();
      byte var1 = this.g[2];
      if (var1 == 0) {
         return "";
      } else {
         return this.g[3] == 0 ? Encoding.getASCII().a(this.g, 4, var1 & 255) : Encoding.getUnicode().a(this.g, 4, 2 * (var1 & 255));
      }
   }

   private void e(Series var1) throws Exception {
      this.b();
      int var2 = com.aspose.cells.b.a.zc.e(this.g, 6) & '\uffff';
      int var3 = com.aspose.cells.b.a.zc.e(this.g, 4) & '\uffff';
      if (var2 != 0) {
         byte[] var4 = new byte[var2 + 2];
         System.arraycopy(this.g, 6, var4, 0, var2 + 2);
         zik var5 = zin.a(this.j, this.k);
         switch(var4[2]) {
         case 57:
         case 89:
         case 121:
            var5.a(4);
            break;
         case 58:
         case 60:
         case 90:
         case 92:
         case 122:
         case 124:
            var5.a(2);
            if (var2 != 7) {
               var5.a(5);
            }
            break;
         case 59:
         case 61:
         case 91:
         case 93:
         case 123:
         case 125:
            var5.a(3);
            if (var2 != 11) {
               var5.a(5);
            }
            break;
         default:
            var5.a(5);
         }

         var5.a(var4);
         switch(this.g[0]) {
         case 0:
            var1.a((Object)var4);
            break;
         case 1:
            var1.a(var5);
            var1.c = var3;
            break;
         case 2:
            var1.b(var5);
            break;
         case 3:
            var1.c(var5);
         }
      }

   }

   private void b(ChartFrame var1) throws Exception {
      this.b();
      var1.setShadow((this.g[0] & 255 & 4) != 0);
      var1.g((this.g[2] & 255 & 1) != 0);
   }

   private void h(Axis var1) throws Exception {
      this.b();
      if ((this.g[8] & 255 & 8) != 0 && (this.g[8] & 255 & 4) == 0 && this.g[4] == 5) {
         var1.setVisible(false);
      }

      if (var1.isVisible()) {
         Line var2 = var1.getAxisLine();
         boolean var3 = (this.g[8] & 255 & 1) != 0;
         if (!var3) {
            var2.m(0);
            switch(this.g[4]) {
            case 0:
               var2.m(0);
               break;
            case 1:
               var2.m(1);
               break;
            case 2:
               var2.m(2);
               break;
            case 3:
               var2.m(3);
               break;
            case 4:
               var2.m(4);
               break;
            case 5:
               var2.setVisible(false);
               break;
            case 6:
               var2.m(6);
               break;
            case 7:
               var2.m(7);
               break;
            case 8:
               var2.m(8);
            }

            switch(this.g[6]) {
            case -1:
               var2.setWeight(-1);
               break;
            case 0:
               var2.setWeight(0);
               break;
            case 1:
               var2.setWeight(1);
               break;
            case 2:
               var2.setWeight(2);
            }

            if ((this.g[10] & 255) < 64) {
               var2.a(this.b(this.g, 0));
            }

         }
      }
   }

   private void a(Line var1) throws Exception {
      this.b();
      boolean var2 = (this.g[8] & 255 & 1) != 0;
      if (var2) {
         var1.b(var2);
      } else {
         var1.m(0);
         switch(this.g[6]) {
         case -1:
            var1.setWeight(-1);
            break;
         case 0:
            var1.setWeight(0);
            break;
         case 1:
            var1.setWeight(1);
            break;
         case 2:
            var1.setWeight(2);
         }

         int var3 = this.g[10] & 255;
         if (var3 < 64) {
            var1.a(this.j.m().e(var3));
         }

         switch(this.g[4]) {
         case 0:
            var1.m(0);
            break;
         case 1:
            var1.m(1);
            break;
         case 2:
            var1.m(2);
            break;
         case 3:
            var1.m(3);
            break;
         case 4:
            var1.m(4);
            break;
         case 5:
            var1.setVisible(false);
            break;
         case 6:
            var1.m(6);
            break;
         case 7:
            var1.m(7);
            break;
         case 8:
            var1.m(8);
         }

      }
   }

   private void a(zjc var1) throws Exception {
      this.b();
      var1.a(com.aspose.cells.b.a.zc.e(this.g, 0));
   }

   private void d(Area var1) throws Exception {
      this.b();
      boolean var2 = (this.g[10] & 255 & 1) != 0;
      var1.setInvertIfNegative((this.g[10] & 255 & 2) != 0);
      if (var2) {
         var1.setFormatting(0);
      } else {
         switch(this.g[8]) {
         case 0:
            var1.setFormatting(1);
            break;
         case 1:
            var1.setFormatting(2);
            break;
         case 2:
            var1.getFillFormat().setPattern(7);
            break;
         case 3:
            var1.getFillFormat().setPattern(10);
            break;
         case 4:
            var1.getFillFormat().setPattern(13);
            break;
         case 5:
            var1.getFillFormat().setPattern(25);
            break;
         case 6:
            var1.getFillFormat().setPattern(24);
            break;
         case 7:
            var1.getFillFormat().setPattern(16);
            break;
         case 8:
            var1.getFillFormat().setPattern(17);
            break;
         case 9:
            var1.getFillFormat().setPattern(37);
            break;
         case 10:
            var1.getFillFormat().setPattern(42);
            break;
         case 11:
            var1.getFillFormat().setPattern(21);
            break;
         case 12:
            var1.getFillFormat().setPattern(20);
            break;
         case 13:
            var1.getFillFormat().setPattern(14);
            break;
         case 14:
            var1.getFillFormat().setPattern(15);
            break;
         case 15:
            var1.getFillFormat().setPattern(35);
            break;
         case 16:
            var1.getFillFormat().setPattern(5);
            break;
         case 17:
            var1.getFillFormat().setPattern(4);
            break;
         case 18:
            var1.getFillFormat().setPattern(2);
         }

         if (var1.getFormatting() == 2 && var1.getFillFormat().getType() == 2) {
            int var3 = com.aspose.cells.b.a.zc.a(this.g, 0);
            int var4 = com.aspose.cells.b.a.zc.e(this.g, 12) & '\uffff';
            if (var3 == 0 && var4 < 64) {
               var1.getFillFormat().getSolidFill().a.a(3, com.aspose.cells.b.a.zc.e(this.g, 12) & '\uffff');
            } else {
               var1.getFillFormat().getSolidFill().a.a(2, this.b(this.g, 0).toArgb());
            }

            var3 = com.aspose.cells.b.a.zc.a(this.g, 4);
            var4 = com.aspose.cells.b.a.zc.e(this.g, 14) & '\uffff';
            if (var3 == 0 && var4 < 64) {
               var1.getFillFormat().getSolidFill().b.a(3, com.aspose.cells.b.a.zc.e(this.g, 14) & '\uffff');
            } else {
               var1.getFillFormat().getSolidFill().b.a(2, this.b(this.g, 4).toArgb());
            }
         }

      }
   }

   private void a(Marker var1) throws Exception {
      this.b();
      boolean var2 = (this.g[10] & 255 & 1) != 0;
      if (!var2) {
         switch(this.g[8]) {
         case 0:
            var1.setMarkerStyle(5);
            break;
         case 1:
            var1.setMarkerStyle(7);
            break;
         case 2:
            var1.setMarkerStyle(3);
            break;
         case 3:
            var1.setMarkerStyle(9);
            break;
         case 4:
            var1.setMarkerStyle(10);
            break;
         case 5:
            var1.setMarkerStyle(8);
            break;
         case 6:
            var1.setMarkerStyle(4);
            break;
         case 7:
            var1.setMarkerStyle(2);
            break;
         case 8:
            var1.setMarkerStyle(1);
            break;
         case 9:
            var1.setMarkerStyle(6);
         }

         var1.setMarkerSize((com.aspose.cells.b.a.zc.e(this.g, 16) & '\uffff') / 20);
         int var3;
         if ((this.g[10] & 255 & 16) != 0) {
            var1.d(1);
         } else {
            var3 = com.aspose.cells.b.a.zc.e(this.g, 14) & '\uffff';
            switch(var3) {
            case 255:
               var1.b(Color.fromArgb(this.g[4] & 255, this.g[5] & 255, this.g[6] & 255));
               break;
            default:
               var1.b(this.i.e(var3));
            }
         }

         if ((this.g[10] & 255 & 32) != 0) {
            var1.c(1);
         } else {
            var3 = com.aspose.cells.b.a.zc.e(this.g, 12) & '\uffff';
            switch(var3) {
            case 79:
               var1.a(Color.getBlack());
               break;
            case 255:
               var1.a(Color.fromArgb(this.g[0] & 255, this.g[1] & 255, this.g[2] & 255));
               break;
            default:
               var1.a(this.i.e(var3));
            }
         }

      }
   }

   private void A() throws Exception {
      this.e.a(2);
   }

   private void B() throws Exception {
      this.e.a(18);
   }

   private void C() throws Exception {
      this.e.a(2);
   }

   private void D() throws Exception {
      this.e.a(2);
   }

   private ziz f(int var1) {
      if (var1 >= this.b.m().getCount()) {
         int var2 = var1 - this.b.m().getCount() + 1;

         for(int var3 = 0; var3 < var2; ++var3) {
            ziz var4 = new ziz(this.b.m());
            this.b.m().a(var4);
         }
      }

      return this.b.m().a(var1);
   }

   private String g(int var1) {
      Iterator var2 = this.j.A().iterator();

      zxw var3;
      do {
         if (!var2.hasNext()) {
            return "";
         }

         var3 = (zxw)var2.next();
      } while(var3.b() != var1);

      return var3.a();
   }

   private void E() throws Exception {
      int var1 = 0;

      while(true) {
         this.f = this.e.b(this.d);
         switch(this.f) {
         case 10:
         case 574:
            throw new IOException("File is corrupted");
         case 4147:
            this.C();
            ++var1;
            break;
         case 4148:
            this.D();
            --var1;
            if (var1 == 0) {
               return;
            }
            break;
         default:
            this.h = this.e.b(this.d);
            this.e.a(this.h & '\uffff');
         }
      }
   }

   private int h(int var1) {
      switch(var1) {
      case 0:
         return 0;
      case 1:
         return 1;
      case 2:
         return 2;
      default:
         return 0;
      }
   }

   private Color b(byte[] var1, int var2) {
      return Color.fromArgb(var1[var2] & 255, var1[var2 + 1] & 255, var1[var2 + 2] & 255);
   }

   private Color c(byte[] var1, int var2) {
      short var3 = com.aspose.cells.b.a.zc.b(var1, var2);
      return this.j.m().e(var3);
   }

   private void n(ziz var1) {
      zor var2 = var1.e();
      if (var2 != null) {
         switch(var1.j()) {
         case 9:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
                  var1.b(53);
               case 2:
               default:
                  break;
               case 3:
                  var1.b(31);
                  break;
               case 4:
                  var1.b(24);
               }
            }
            break;
         case 10:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
                  var1.b(54);
               case 2:
               default:
                  break;
               case 3:
                  var1.b(32);
                  break;
               case 4:
                  var1.b(25);
               }
            }
            break;
         case 11:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
               case 2:
                  var1.b(55);
                  break;
               case 3:
                  var1.b(33);
                  break;
               case 4:
               case 5:
                  var1.b(26);
               }
            }
         case 12:
         case 13:
         case 14:
         case 15:
         case 16:
         default:
            break;
         case 17:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
                  var1.b(56);
               case 2:
               default:
                  break;
               case 3:
                  var1.b(34);
                  break;
               case 4:
                  var1.b(27);
               }
            }
            break;
         case 18:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
                  var1.b(50);
               case 2:
               default:
                  break;
               case 3:
                  var1.b(28);
                  break;
               case 4:
                  var1.b(21);
               }
            }
            break;
         case 19:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
                  var1.b(51);
               case 2:
               default:
                  break;
               case 3:
                  var1.b(29);
                  break;
               case 4:
                  var1.b(22);
               }
            }
            break;
         case 20:
            if (var2.d) {
               switch(var2.d()) {
               case 1:
               case 2:
                  var1.b(52);
                  break;
               case 3:
                  var1.b(30);
                  break;
               case 4:
               case 5:
                  var1.b(23);
               }
            }
         }

      }
   }

   private void o(ziz var1) {
      zor var2 = var1.e();
      if (var2 != null) {
         if (var2.k() != null && var2.j().getMarkerStyle() == 5) {
            switch(var1.j()) {
            case 40:
               var1.b(37);
               break;
            case 41:
               var1.b(38);
               break;
            case 42:
               var1.b(39);
            }

         }
      }
   }

   private void p(ziz var1) {
      zor var2 = var1.e();
      if (var2 != null) {
         if (var2.i() != null && var2.l().a() != 0) {
            switch(var1.j()) {
            case 35:
               var1.b(36);
               break;
            case 44:
               var1.b(47);
               break;
            case 45:
               var1.b(48);
            }

         }
      }
   }

   private void q(ziz var1) {
      zor var2 = var1.e();
      if (var2 != null) {
         if (var2.o()) {
            var1.b(13);
         }

      }
   }

   private void r(ziz var1) {
      zor var2 = var1.e();
      if (var2 != null) {
         boolean var3 = var2.k() == null || var2.j().getMarkerStyle() != 5;
         if (!var3) {
            var1.b(57);
         }

      }
   }

   private void a(ziz var1, zor var2) {
      boolean var3 = var2.k() == null || var2.j().getMarkerStyle() != 5;
      boolean var4 = var2.g() == null || var2.f().isVisible();
      boolean var5 = var2.m();
      if (!var4) {
         var1.b(60);
      } else {
         if (var3) {
            if (var5) {
               var1.b(61);
            } else {
               var1.b(63);
            }
         } else if (var5) {
            var1.b(62);
         } else {
            var1.b(64);
         }

      }
   }

   private void s(ziz var1) {
      zor var2 = var1.e();
      if (var2 == null && this.b.getNSeries().getCount() == 1) {
         var2 = this.b.getNSeries().get(0).g();
      }

      if (var2 != null) {
         switch(var1.j()) {
         case 6:
         case 7:
         case 8:
         case 9:
         case 10:
         case 11:
         case 14:
         case 15:
         case 16:
         case 17:
         case 18:
         case 19:
         case 20:
            this.n(var1);
            break;
         case 12:
            this.q(var1);
         case 13:
         case 21:
         case 22:
         case 23:
         case 24:
         case 25:
         case 26:
         case 27:
         case 28:
         case 29:
         case 30:
         case 31:
         case 32:
         case 33:
         case 34:
         case 36:
         case 37:
         case 38:
         case 39:
         case 43:
         case 46:
         case 47:
         case 48:
         case 49:
         case 50:
         case 51:
         case 52:
         case 53:
         case 54:
         case 55:
         case 56:
         case 57:
         case 59:
         case 60:
         case 61:
         case 62:
         default:
            break;
         case 35:
         case 44:
         case 45:
            this.p(var1);
            break;
         case 40:
         case 41:
         case 42:
            this.o(var1);
            break;
         case 58:
            this.r(var1);
            break;
         case 63:
            this.a(var1, var2);
         }

      }
   }
}
